﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Main.master" AutoEventWireup="true"
    CodeFile="MuayeneListesi.aspx.cs" Inherits="Ithalat_MuayeneListesi" Theme="Main" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="Server">

    <script type="text/javascript">

        $(function() {

            //Arama Panelini Ac Kapat
            $('#<%=LabelArama.ClientID %>').click(function(e) {
                e.preventDefault();

                var panelArama = $('#<%=PanelArama.ClientID %>');
                if (panelArama.css('display') == 'none') {
                    panelArama.slideDown('fast');
                    $(this).html('Arama Kapat');
                    $('#<%=ImageZoomInOutBildirimArama.ClientID %>').attr('src', '../App_Themes/Main/Images/Buttons/zoom_out.png');
                }
                else {
                    panelArama.slideUp('fast');
                    $(this).html('Arama Aç');
                    $('#<%=ImageZoomInOutBildirimArama.ClientID %>').attr('src', '../App_Themes/Main/Images/Buttons/zoom_in.png');
                }
            });

            //Secilen Rowu renklendir.
            $('#<%=gvMuayeneler.ClientID %> >tbody >tr >td a.jQuery_SecilenRenklendir').click(function(e) {
                RowSec($(this));
            });
        });

        function RowSec(imageButton) {

            var aktifRowIndex = imageButton.attr("RowIndex");
            var oncekiRowIndex = $("#<%=TextBoxRowIndex.ClientID %>").val();
            $("#<%=TextBoxRowIndex.ClientID %>").val(aktifRowIndex);

            if (oncekiRowIndex != '') {
                oncekiRowIndex = SayfalamaVarsaRowIndexAyarla(oncekiRowIndex);
                $("#<%=gvMuayeneler.ClientID %> >tbody >tr:eq(" + oncekiRowIndex + ")").css('background-color', rowColor);
            }

            aktifRowIndex = SayfalamaVarsaRowIndexAyarla(aktifRowIndex);
            rowColor = $("#<%=gvMuayeneler.ClientID %> >tbody >tr:eq(" + aktifRowIndex + ")").css('background-color');
            $("#<%=gvMuayeneler.ClientID %> >tbody >tr:eq(" + aktifRowIndex + ")").css('background-color', 'LightBlue');
        }

        function SayfalamaVarsaRowIndexAyarla(index) {
            if ($("#<%=gvMuayeneler.ClientID %> >tbody >tr").hasClass("grid1pager") == false) {
                index++;
            }
            else {
                index++;
                index++;
            }
            return index;
        }



    </script>

    <table style="width: 100%; text-align: left">
        <tr>
            <td align="left" valign="middle">
                <asp:Image ID="ImageZoomInOutBildirimArama" runat="server" ImageUrl="~/App_Themes/Main/Images/Buttons/zoom_in.png"
                    ToolTip="Bildirim Ara" />
                &nbsp;
                <asp:Label ID="LabelArama" runat="server" Font-Names="Segoe UI" Font-Size="9pt" Font-Underline="True"
                    ForeColor="Blue" Text="Arama Aç" Style="cursor: hand;">
                </asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Panel ID="PanelArama" runat="server" Style="display: none">
                    <table style="width: 100%;" class="YMAnaTablo">
                        <tr>
                            <th class="ThBaslikRenk1">
                                MUAYENE VE ANALİZ ARAMA
                            </th>
                        </tr>
                        <tr>
                            <td>
                                <table style="width: 100%">
                                    <tr>
                                        <td class="TdRenkSol" style="width: 13%">
                                            Rapor No :
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="TextBoxRaporNo" runat="server" Width="150"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="TdRenkSol">
                                            Analizin Başlama ve Bitiş Tarihi :
                                        </td>
                                        <td colspan="3">
                                            <TKB:TarihTextBoxIkili ID="TarihAnalizBaslamaBitisTarihi" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="TdRenkSol">
                                            Analizin Amacı :
                                        </td>
                                        <td colspan="3">
                                            <asp:TextBox ID="TextBoxAnalizinAmaci" runat="server" TextMode="MultiLine" Width="500"
                                                Height="40"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align: center">
                                <asp:Button ID="ButtonMuayeneAra" runat="server" SkinID="ButtonAra" OnClick="ButtonMuayeneAra_Click"
                                    CausesValidation="false" />
                                <asp:Button ID="ButtonTemizle" runat="server" SkinID="ButtonTemizle" OnClick="ButtonTemizle_Click" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td>
                <table style="width: 100%;" class="YMAnaTablo">
                    <tr>
                        <th id="ThBaslik" runat="server" class="ThBaslikRenk1">
                            MUAYENE VE ANALİZ LİSTESİ
                        </th>
                    </tr>
                    <tr>
                        <td>
                            <table style="width: 100%;">
                                <tr>
                                    <td style="text-align: left">
                                        <asp:Label ID="LabelKayitSayisi" runat="server" Text=""></asp:Label>
                                    </td>
                                    <td style="text-align: right">
                                        <asp:HyperLink ID="HyperLinkEkle" runat="server" ImageUrl="~/App_Themes/Main/Images/Buttons/yenikayitbtn.jpg"></asp:HyperLink>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:GridView ID="gvMuayeneler" runat="server" AutoGenerateColumns="False" Width="100%"
                                DataKeyNames="MuayeneKey" EmptyDataText="Muayene Bulunmamaktadır." OnRowDataBound="gvMuayeneler_RowDataBound"
                                OnPageIndexChanging="gvMuayeneler_PageIndexChanging" AllowPaging="true" PageSize="50"
                                OnSorting="gvMuayeneler_Sorting" AllowSorting="true">
                                <Columns>
                                    <asp:BoundField DataField="SiraNo" HeaderText="SIRA NO" SortExpression="SiraNo" ItemStyle-CssClass="columnborder"
                                        ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="RaporNo" HeaderText="RAPOR NO" SortExpression="RaporNo"
                                        ItemStyle-CssClass="columnborder" />
                                    <asp:BoundField DataField="AnalizBaslamaTarihi" HeaderText="ANALİZ BAŞLAMA TARİHİ"
                                        SortExpression="AnalizBaslamaTarihi" ItemStyle-CssClass="columnborder" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="AnalizBitisTarihi" HeaderText="ANALİZ BİTİŞ TARİHİ" SortExpression="AnalizBitisTarihi"
                                        ItemStyle-CssClass="columnborder" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="AnalizinAmaci" HeaderText="ANALİZ AMACI" SortExpression="AnalizinAmaci"
                                        ItemStyle-CssClass="columnborder" />
                                    <asp:BoundField DataField="NumuneCinsi" HeaderText="NUMUNE CİNSİ" SortExpression="NumuneCinsi"
                                        ItemStyle-CssClass="columnborder" />
                                    <asp:BoundField DataField="GTIPNo" HeaderText="GTIP NO" SortExpression="GTIPNo" ItemStyle-CssClass="columnborder" />
                                    <asp:BoundField DataField="Miktari" HeaderText="MİKTARI" SortExpression="Miktari"
                                        ItemStyle-CssClass="columnborder" />
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            DETAY
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:HyperLink ID="HyperLinkDetayGoruntule" runat="server" ImageUrl="~/App_Themes/Main/Images/Ortak/detay.gif"
                                                ToolTip="Detay Görüntüle" CssClass="jQuery_SecilenRenklendir"></asp:HyperLink>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" CssClass="columnborder" />
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            GÜNCELLE
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:HyperLink ID="HyperLinkGuncelle" runat="server" ImageUrl="~/App_Themes/Main/Images/Ortak/guncelle.gif"
                                                ToolTip="Güncelle" CssClass="jQuery_SecilenRenklendir"></asp:HyperLink>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" CssClass="columnborder" />
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            RAPOR
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:HyperLink ID="HyperLinkRapor" runat="server" ImageUrl="~/App_Themes/Main/Images/Ortak/rapor.gif"
                                                ToolTip="Rapor Yazdır" CssClass="jQuery_SecilenRenklendir"></asp:HyperLink>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" CssClass="columnborder" />
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataRowStyle Font-Bold="True" ForeColor="Red" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <asp:TextBox ID="TextBoxRowIndex" runat="server" Style="display: none"></asp:TextBox>
</asp:Content>
